<template>
<div class="loginPage">
  <div class="loginBox clearfix">
    <div class="pull-right clearfix formBox">
      <div class="textCenter">
        <!-- div style="font-size: 22px; margin-bottom:20px;">欢迎使用</div>
        <div style="font-size: 18px; margin-bottom:20px;">K-BSES 老年人生活能力评估系统</div -->
        <div style="font-size: 13px; margin-bottom:20px;">未登录或登录已过期</div>
      </div>
      <div class="loginForm">
        <form v-on:submit.prevent="loginSys">
        <div class="input-group">
          <label class="input-group-addon">用户名</label>
          <input type="text" class="form-control" name="username" placeholder="用户名" v-model="loginData.username" />
          <span class="input-group-addon">
            <span class="fa fa-user"></span>
          </span>
        </div>
        <div class="input-group">
          <label class="input-group-addon">密 码</label>
          <input type="password" class="form-control" name="password" placeholder="密 码" v-model="loginData.password" />
          <span class="input-group-addon">
            <span class="fa fa-lock"></span>
          </span>
        </div>
        <div>
          <button class="btn btn-primary btn-right" style="width: 100%; padding: 6px 0px; clocr: #555;" type="submit">登 陆</button>
        </div>
        </form>
      </div>
    </div>
  </div>
</div>
</template>
<script>
export default {
  name: 'login',
  data () {
    return {
      loginData: {},
      orgData: {
        logo: './static/images/logo.jpg'
      }
    }
  },
  prpos: {
  },
  methods: {
    loginSys () {
      if (this.loginData.username && this.loginData.password) {
        let formData = new FormData()
        for (let key in this.loginData) {
          formData.append(key, this.loginData[key])
        }
        this.$store.dispatch('login', formData)
      }
    },
    getLogo () {
      let _domain = document.domain
      this.$http.get('organization/getByDomainName?domainName=' + _domain).then(
        response => {
          this.orgData = response.data.data
        }
      )
    }
  },
  created () {
    // this.getLogo()
  }
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
.logoImg{width: 130px;}
.logoImg .img{width: 130px; height: auto; margin-top: 10px;}
.loginForm{width: 100%;}
.input-group {margin-bottom: 15px}
</style>
